home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Programmer Disk
/
The Programmer Disk (Microforum).iso
/
xpro
/
c2
/
pro24
/
read.me
< prev
next >
Wrap
Text File
|
1988-06-21
|
4KB
|
93 lines
Hi!
These routines are the result of many nights of tinkering.
They've been hacked over and over, so they're not especially easy to
follow, but (for the most part,) they work OK, and can be used to add
.PCX file I/O and display facilities to your graphics project.
Incidentally, if you really need something like this for business
purposes, buy a real package! This is NOT a "Serious Graphics System"
(SGS?) I originally put it together in an effort to get schematics into
Ventura Publisher. The vgr_fill() routine was written as part of a
(crazy) pipe dream: to try and build a bigger-than-24-point HPLJ
character set...
Do as you wish with this stuff, It's free for the taking, with only one
restriction: You should consider this to be "Post Ware," ie: if you find
yourself using it, grant me a 'byline' and send a post card!
The file DOC.TXT is a Ventura Publisher source containing the
documentation for these routines.
If you got your hands on a version of this .ARC dated prior to June
21st, 1988:
(1) There was a bug in pcx_read_pic() that was introduced when I
removed the call to my bufread() library function and replaced it with
the standard I/O fread() call - the comparison should be against a count
of 1 instead of a structure size of sizeof(*ph).
(2) The declaration "int (*vgr_func[14])();" in vgr.h should read
"int (*vgr_func[15])();".
(3) The pcx_free_pic() function has two obviously silly
"debugging" lines in it. You'll find them real quick when you try to
use that function! (it puts you back in text mode and tells you that
you're probably out of memory... true if it's called from a function
that had a memory allocation problem, but otherwise not true...)
The file VGRX is new. It's got a routine in it that was made from part
of main() in PCX.C; the function of which is to figure out what video
board is in use, and set up some variables that make using the VGR
routines easier.
vgr_setup() takes a pointer to char called specifier. If the
"specifier" pointer is non-null, it's assumed to point to a string which
is used to force the routine to assume a particular board. This may
turn out to be handy with non-cga/ega/herc graphic boards, and
especially in those cases where the board detect logic fails. If the
pointer is NULL, then it's ignored and the routine uses vgr_get_board()
to try to figure out what board you've got. See the listing to get the
names of all the global variables in vgr.h that're affected by
vgr_setup(). Note also that there's no way of returning a board type
number for the CGA 320x200x4 mode, so the kludge solution was to set
the type number to 9. I would have just added an extra #define for a board
of that type, but I didn't like the idea of the added confusion with the
mode number. (in the mean time, it's gotten confusing...)
Note that your program must allocate all globals by #DEFINEing ALLOCATE
before #including "vgr.h"! Otherwise, you'll get undefined globals at
link time.
The PCXSHOW program seems to work fine, it's only been tested on an ATI
EGA Wonder, which doesn't seem to be 100% compatible. It just dumps the
contents of the picture into the VRAM, so some pictures won't look
exactly like they did when they were generated, but it does give a good
idea of what the picture is about. (Sorry; I had planned on writing a
picture format converter - it wouldn't be difficult, just pcx_init_pic()
two picture structs for the two different formats, then "get" a pixel
from one and "set" it into another - just too many higher priority items
on the back burner as it is...)
The IBMTIMER.c module is from my lib. I figured it's ok to add to this
.ARC since it's small enough and doesn't call in any other modules.
Another note: I still haven't tried some of the palette functions, so
they're still not to be considered reliable. (Most of the EGA stuff
should be OK, the CGA stuff was never tested.)
I hope this'll be handy for you!
Sam Azer
AzerTech Computer Systems
2095 Patricia Ave, #1
Montreal, Quebec, Canada
H4B 1Y7